#include "commond.hpp"
#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstring>
#include <cstdio>
const std::string path = "./temp/mypipe";

int main()
{
    int wfd = open(path.c_str(), O_WRONLY);
    if(wfd == -1)
    {
        std::cout << "open file" << std::endl;
    }

    char buffer[1024];
    while(1)
    {
        std::cout << "please say# ";
        fgets(buffer, sizeof(buffer), stdin);
        buffer[strlen(buffer) - 1] = 0;
        write(wfd, buffer, strlen(buffer));
    }
    return 0;
}